<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
     <%@ page import = "javax.servlet.http.HttpSession" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript"> src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>  
<script>
  $(document).ready(function() {
    $("#datepicker").datepicker();
  });

function stopRKey(evt) { 
	  var evt = (evt) ? evt : ((event) ? event : null); 
	  var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); 
	  if (evt.keyCode == 13)  {return false;} 
	} 

	document.onkeypress = stopRKey; 
	
	function check() {
	    var dropdown = document.getElementById("choose");
	    var current_value = dropdown.options[dropdown.selectedIndex].value;

	    if (current_value == "Sale") {
	        document.getElementById("StockItems").style.display = "block";
	    }
	    else {
	        document.getElementById("StockItems").style.display = "none";
	    }
	}

</script>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.css">
<title>Purchase</title>
</head>
<body>
<% 
		String un = (String) session.getAttribute("name");
		if(un!=null){ %>
		
		<nav class="navbar navbar-default navbar-fixed-top " role="navigation">
		<div class="container-fluid">
		<div class="navbar-header">
		<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      </div>	
   
   <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav navbar-right">
      <li><a href="UserPanel.jsp">Home</a></li>
      <li><a href="LogOut">LogOut</a></li>
      </ul></div>
		</nav><br><br><br>
		
		<div class="container">

    	
    	<h2 class="text-center login-title" >EZRiceMillSystem</h2>
    	<div class="col-sm-2 col-md-4 col-md-offset-4">
	<h4 class="text-center login-title">Welcome User</h4>
	</div></div>
  		
  		<div class=" col-md-4 col-md-offset-4">
  <div class="well">
  
    
     
        <fieldset>
          <legend>Reports</legend>
    		
<style>
	.navbar-header {
    float: left;
    padding: 5px;
    text-align: center;
    width: 95%;
}
.navbar-brand {float:none;}	
</style>
<div class="control-group">
<label class="control-label">Select a Rice Mill</label>
  <div class="controls">
              <div class="row-fluid">
                <div class="span9">
<form name="Reports form" action ="Reports" method="post">
  <select class="input-block-level" name="RiceMill">
  <option value="Selection">---- Please select ----</option>
    <option value="Ramsar Rice & General Mills">Ramsar Rice & General Mills</option>
    <option value="Ramsar Rice Mills Pvt. Ltd.">Ramsar Rice Mills Pvt. Ltd.</option>
    <option value="Sardar Commission Agents">Sardar Commission Agents</option>
    <option value="Kwality Rice Mills Pvt. Ltd.">Kwality Rice Mills Pvt. Ltd.</option>
    <option value="Singh's Agro Traders">Singh's Agro Traders</option>
    <option value="Kumar Commission Agents">Kumar Commission Agents</option>
    </select>
                </div>
                </div>
                </div>
    <div class="control-group">
<label class="control-label">Select an Agency</label>
  <div class="controls">
              <div class="row-fluid">
                <div class="span9">
     <select class="input-block-level" name="Agency">
  <option value="Selection">---- Please select ----</option>
    <option value="Agency1">Agency1</option>
    <option value="Agency2">Agency2</option>
    <option value="Agency3">Agency3</option>
    <option value="Agency4">Agency4</option>
    <option value="Agency5">Agency5</option>
    <option value="Agency6">Agency6</option>
   </select>
                </div>
                </div>
                </div>
 <div class="control-group">
<label class="control-label">Please Select</label>
  <div class="controls">
              <div class="row-fluid">
                <div class="span9">
  <select class="input-block-level" name="choose" id = "choose" onchange="check();">
     <option value="Sale">Sale</option>
    <option value="Purchase">Purchase</option>
   
</select>
                </div>
                </div>
                </div>
                
                <div class="control-group">
<label class="control-label">Select a Stock Item</label>
  <div class="controls">
              <div class="row-fluid">
                <div class="span9">
 <select class="input-block-level" id = "StockItems" name = "StockItems">
  <option value="Selection">---- Please select ----</option>
    <option value="Rice">Rice</option>
    <option value="Husk">Husk</option>
    <option value="Rice Bran">Rice Bran</option>
    <option value="Kani/Nakku">Kani/Nakku</option>
    <option value="Bardaana">Bardaana</option>
  </select>
                </div>
                </div>
                </div>
   <div class="control-group">
  <label class="control-label">From</label>
  <div class="controls"> 
  <input id="datepicker" type = "date" name="StartDate">
  <div class="control-group">
  <label class="control-label">To</label>
  <div class="controls">
  <input id="datepicker" type = "date" name="EndDate"><br><br>
   <button class="btn btn-lg btn-primary btn-block" type="submit">
				Report</button>
</form>
<br><br>
<%}
else{  
	out.println("<script type=\"text/javascript\">");
	   out.println("alert('Please login first');");
	   out.println("location='index.jsp';");
	   out.println("</script>");  
        } 
         %>

	</body>
</html>